package com.opengisagrario;

import com.opengisagrario.utils.GestionItems;
import com.opengisagrario.utils.ItemAdapter;

import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.view.View;
import android.widget.ListView;
import android.app.Activity;

public class InicioList extends Activity {

	public FragmentActivity activity;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_inicio_list);
	}
	
	
    public static void populateList(View rootView, FragmentActivity activity){
		GestionItems.LoadGestionItems();
		ListView listView = (ListView) rootView.findViewById(R.id.listViewGestion);
		String[] ids = new String[GestionItems.Items.size()];
		for (int i= 0; i < ids.length; i++){
            ids[i] = Integer.toString(i+1);
        }
		ItemAdapter adapter = new ItemAdapter(activity,R.layout.items, ids);
        listView.setAdapter(adapter);
    }

}
